﻿package scrn;


import java.awt.*;

import javax.swing.*;

import core.*;


// ======================================================== Панель для рисования
public class DrawPanel extends JPanel {

// ================================================================== Переменные
private static final long serialVersionUID = 1L;
private Dimension oldDim = new Dimension(0, 0);
private Dimension newDim = new Dimension(0, 0);


// =============================================================== Инициализаыия
public DrawPanel() {

}


// =================================================================== Отрисовка
@Override
public void paintComponent(Graphics g) {

	this.getSize(newDim);
	if (newDim.width != oldDim.width || newDim.height != oldDim.height) {
		//		Mess.m("DrawPanel.paintComponent", newDim.width + "x" + newDim.height);
		oldDim.height = newDim.height;
		oldDim.width = newDim.width;

		newDim.height -= 4;
		newDim.width -= 4;

		Draw.setDim(newDim);
		Man.scrMan.setSize();
	}
	g.drawImage(Draw.scrImg, 2, 2, null);
}
}
